<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
  	<base href="<%=basePath%>">  
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    

<TITLE>DAWU DOOR CONTROL</TITLE>
<LINK REL="stylesheet" HREF="css/dwlogin.css" TYPE="text/css">
<LINK REL="stylesheet" HREF="css/index.css" TYPE="text/css">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="dawutech" content="dwdoor">
<script type="text/javascript" src="lang/b28n.js"></script>
<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="js/jquery-cookie.js"></script>
<script type="text/javascript">
Butterlate.setTextDomain("dwdoor");
var version="V16.11.24d01";
function initTranslation()
{
//    var e = document.getElementById("Exit");
    $("#Exit").text( _("Exit_L") );
//	alert("e:"+e.innerHTML);
    var e = document.getElementById("Mb1");
    e.innerHTML = _("basicstate");
	var e = document.getElementById("sb11");
    e.innerHTML = _("opendoorintime");
	var e = document.getElementById("sb12");
    e.innerHTML = _("generalconfig");
	var e = document.getElementById("sb13");
    e.innerHTML = _("router");
	var e = document.getElementById("Mb2");
    e.innerHTML = _("staffsetting");
	var e = document.getElementById("sb21");
    e.innerHTML = _("setting");
	var e = document.getElementById("Mb3");
    e.innerHTML = _("attendance");
	var e = document.getElementById("sb31");
    e.innerHTML = _("attendancesetting");
	$("#sb32").text( _("holidaysetting") );
	$("#sb33").text( _("offsetting") );
	$("#sb34").text( _("forcework") );
	$("#sb35").text( _("attendancestatistics") );
}

/*height css*/
function iFrameHeight() 
{ 
	var ifm= document.getElementById("iframepage"); 
	var subWeb = document.frames ? document.frames["formframe"].document : ifm.contentDocument; 
	if(ifm != null && subWeb != null) 
	{ 
		if(subWeb.body.scrollHeight<1050)
			ifm.height = 1050; 
		else
			ifm.height = subWeb.body.scrollHeight;
	} 
}
/*open url*/ 
function showUrl(url,name, topflag)
{			
	var ifm= document.getElementById("iframepage"); 
	ifm.height = 1050;
    if(topflag)
    {
        top.window.location.href = url;
    }
    else
    {
        window.open(url,name);
    }
	
}
/*show basic memu start*/ 
function basicShow()
{
    showBMenu('1','1');
	showUrl('/dw/door/doorcontrol.jsp','formframe');	
	document.getElementById('basicMenu').style.display='';	
}
function showBMenu(mid,sum)
{
	var i=1;
	for(i=1;i<=2;i++)
	{
        var id = '#mb'+ i;
		if(mid==i){		
			document.getElementById('mb'+i).style.fontWeight='bold';	
            $(id).addClass("current");
            $(id).parent().addClass("current");
		}	
		else{
			document.getElementById('mb'+i).style.fontWeight='normal';	
            $(id).removeClass("current");
            $(id).parent().removeClass("current");
		}	
        id = '#sb'+ i;
		if(mid==i){
            $(id).find("dd").removeClass("hidden");
			document.getElementById('sb'+i).style.display='';
		}	
		else{
			document.getElementById('sb'+i).style.display='none';
		}
		showBSub(mid,'1',sum);
	}
}
function showBSub(mid,subnub,sum)
{
	var i=1;
	for(i=1;i<=sum;i++){
        var id = '#sb'+mid+ i;
		if(subnub==i){
            $(id).addClass("current");
		}	
		else{
            $(id).removeClass("current");
		}
	}
}

function checkCookie(){
	  	var a = $.cookie('logon') === "null" || !$.cookie('logon');
	  	if(a){
	  		top.window.location.pathname = '/dw/index.jsp';
	  	}else{
		    var date = new Date();
		    date.setTime(date.getTime() + (60 * 60 * 1000));
		    $.cookie('logon',true,{expires: date});		 
		}
}
function onInit()
{
	checkCookie();
	basicShow();
//	initTranslation();
}
</script>
<style type="text/css">
.header {
    background: url("images/headbg.png") no-repeat scroll center center;
    display: block;
    height: 130px;
    margin: 0 auto;
    width: 1024px;
}
    .logo {
    display: inline-block;
    height: 40px;
    padding: 24px 44px 26px 30px;
    width: 950px;
}
.exit {
    background-color: #fff;
    border: 1px solid #d5d5d5;
    border-radius: 6px;
    color: #359fd6;
    cursor: pointer;
    display: inline-block;
    float: right;
    height: 30px;
    line-height: 32px;
    margin-top: 6px;
    text-align: center;
    width: 83px;
}
.exit a {
    color: #359fd6;
    text-decoration: none;
}
.exit img {
    margin-right: 3px;
    vertical-align: sub;
}

div.no-pad-top{
    padding-top: 0px;

}
</style>
</HEAD>

<BODY onLoad="onInit();" class="all_body">

<div class="header">
        <div class="logo">
            <img src="images/logo.png">
            <div class="exit">
                <a href=""><img src="images/exit.png" /><span id="Exit">退出</span></a>
            </div>
        </div>
</div>
<div class="content" id="page" style="border-right-color:#FFFFFF;">
  <div id='bgDiv' style="display:none;">&nbsp;</div>
    <div class="left">
		<div style="display:block;" id="basicMenu">
		    <ul><li id="mb1" onClick="showBMenu('1','3');showUrl('/dw/door/doorcontrol.jsp','formframe');"><img src="images/basic_info.png" align="absmiddle" id="imgb1"/><span id="Mb1">&nbsp;基本状态</span></li></ul>
                <dl id="sb1">
                    <dd id="sb11" onClick="showBSub('1','1','3');showUrl('/dw/door/doorcontrol.jsp','formframe');">实时监控</dd>
                    <dd id="sb12" onClick="showBSub('1','2','3');showUrl('/dw/door/gatesetting.jsp','formframe');">一般设置</dd>
				    <dd id="sb13" onClick="showBSub('1','3','3');showUrl('/dw/door/serversetting.jsp','formframe');">服务器设置</dd> 
				</dl>
				
		    <ul><li id="mb2" onClick="showBMenu('2','1');showUrl('/dw/door/staffbasesetting.jsp','formframe');"><img src="images/yuangong-qinkuang.png" align="absmiddle" id="imgb2"/><span id="Mb2">员工设置</span></li></ul> 
                <dl id="sb2">
                    <dd id="sb21" onClick="showBSub('2','1','1');showUrl('/dw/door/staffbasesetting.jsp','formframe');">参数设置</dd>				
                </dl>            				
        </div>
	</div>	
<script>
	var isIE6= /msie 6/i.test(navigator.userAgent); 
 	if(!isIE6)
	{
		document.write("<div id=\"iframe_div\"><iframe name=\"formframe\" id=\"iframepage\" src=\"/dw/door/staffbasesetting.jsp\" allowTransparency=\"true\" frameborder=\"0\" scrolling=\"no\" width=\"1024px\" height=\"100%\" onload=\"Javascript:iFrameHeight()\"></iframe></div>"); 
	}else
	{
		document.write("<div id=\"iframe_div1\"><iframe name=\"formframe\" id=\"iframepage\" src=\"/dw/door/staffbasesetting.jsp\" allowTransparency=\"true\" frameborder=\"0\" scrolling=\"no\" width=\"1024px\" height=\"100%\" onload=\"Javascript:iFrameHeight()\"></iframe></div>"); 
	}
</script>  
	<div class="clear"></div>
    <div id="helpline">&nbsp;</div>
</div>
<div id="footer" class="footer">版权所有 © 2015深圳大兀技术有限公司</div>
</BODY>
<script type="text/javascript">
$(document).ready(function()
{    
	$(function()
	{
//		console.log(document.cookie);
//		console.log($.cookie('logon'));
		if($.cookie('logon') === "null" || !$.cookie('logon'))
		{
//			console.log("go to login.jsp");
		    top.window.location.pathname = '/dw/index.jsp';
		} 	
	});
	
    $('.exit').on('click',function()
		{
            $.cookie('logon',null,{path:"/"}); 
			top.window.location.pathname = '/dw/index.jsp';
            return true;

        });
 });
</script>
</HTML>
